Block B
Course Information In this course we will extend the qubit concept and start doing some algebra. We will learn how to manipulate qubits, how quantum logical gates works, and try defining the Y, Z and phase gates, giving us the full range of single qubit gates used in this mod: X, Y, Z, Hadamard, S and T. (S and T are both phase gates). Prerequisites Course Block A Theory The theory section in this course is divided up into lectures. For the quantum computing theory, we're gonna use parts of the video series Quantum Computation for the determined. It's a series of short video lectures given out by a well known phycisist and author named Michael Nielsen. It aims to teach non quantum physicists quantum computing. Each lecture will require you to watch a few of those videos. Lecture 1 '- qubits, vectors and bases' Watching list: Videos 1 and 2. Qubits extended By watching Nielsen we have improved the concept of a qubit that we developed in the last course. A qubit is the unit of quantum information, and also - it represents the simplest possible quantum system! A general qubit can be written as such: |\psi\rangle = a|0\rangle + b|1\rangle In the last course we referred to 'a' and 'b' loosely as probabilities tied to the bit values |0> and |1>. When we measure a qubit we get either |0> or |1>, and the numbers determines the probabilities for each. Nielsens videos has now unveiled more information. They are numbers, and the square of the absolute values of these numbers are the actual probabilities. If 'a' is 0.5, we would have to square that to get the probablity of getting |0> when measuring - 0.5 * 0.5 = 0.75 = 75% Nielsen also shows us what |0> and |1> are, in a more mathematical sense. They form an orthonormal basis for all possible qubit states. Orthonormal only means that this basis is in fact a "legal" basis. An analogy could be made with the real plane (a.k.a. the 2D plane). We can use the unit vectors of x (1,0) and y (0,1), to express any point in the plane (a,b) as a linear combination of those vectors: (a,b) = a(1,0) + b(0,1) (2,5) = 2*(1,0) + 5*(0,1) Lecture 2 - Single qubit quantum gates, measuring Watch list: Videos 3, 4 and 5. Quantum logical gates Quantum logical gates "acts" on qubit states. The quantum NOT gate acts on the basis states in the following way: X|0\rangle = |1\rangle X|1\rangle = |0\rangle The Hadamard is slightly more complex. It acts on the basis states in the following way: H|0\rangle = \frac{(|0\rangle + |1\rangle)} {\sqrt 2} H|1\rangle = \frac{(|0\rangle - |1\rangle)} {\sqrt 2} The Hadamard gate will put a qubit in either of the basis states into a superposition of the two basis states. Measuring When measuring a qubit, the state will collapse into either |0> or |1>. The chance for each is determined by the two numbers 'a' and 'b'. When a qubit has been measured, it no longer contains any (hidden) information about 'a' and 'b', and thus the measuring operation is irreversible. Matrix notation Qubits and gates can be expressed using vectors and matrices. The vectors |0> and |1> has the following representations: |0\rangle = (1,0) = \left1 \\ 0 \end{matrix}\right |1\rangle = (0,1) = \left0 \\ 1 \end{matrix}\right An arbitrary qubit state can be written as a linear combination of |0> and |1>: |\psi\rangle = \alpha|0\rangle + \beta|1\rangle = (\alpha,\beta) = \left\alpha \\ \beta \end{matrix}\right This is just a different way of doing things. When applying a gate to a qubit state, we do matrix-vector multiplication. Take the NOT, or X gate for example. It has the following matrix representation: X = \left0 & 1\\ 1 & 0 \end{matrix}\right Applying this to |0> would be multiplying X with |0>: X|0\rangle = \left0 & 1\\ 1 & 0 \end{matrix}\right \left1 \\ 0 \end{matrix}\right = \left0 \\ 1 \end{matrix}\right More single qubit gates This is the matrix representations for X, Y, Z and the Hadamard X = \left0 & 1\\ 1 & 0 \end{matrix}\right, Y = \left0 & -i \\ i & 0 \end{matrix}\right, Z = \left1 & 0 \\ 0 & -1 \end{matrix}\right, H = \frac{1}{\sqrt(2)} \left1 & 1\\ 1 & -1 \end{matrix}\right The X gate is the quantum NOT gate, as we've already seen. It also represents a rotation around an axis, but we need more theory to understand how and why. The Y and Z gates acts on a qubit in the same way, in a sense, but their axes of rotation are different. Lecture 3 - Multigates and qubit composition Watch list: Video 9 Basics The controlled-NOT gate (or cNOT) acts on the combined state of two qubits. If they are not in superpositions, their possible states would be |00>, |01>, |10> and |11>. |00> for example would be "two qubits, each in the state 0". These four states can be used as the four basis states for a two-qubit state, just as |0> and |1> are the basis states for a single qubit. The controlled NOT-acts in the following way on the basis states: cNOT \cdot |00\rangle = |00\rangle cNOT \cdot |01\rangle = |10\rangle cNOT \cdot |10\rangle = |11\rangle cNOT \cdot |11\rangle = |10\rangle A general two qubit state could be expressed as such: |\psi\rangle = \alpha |00\rangle + \beta |01\rangle + \gamma |10\rangle + \delta|11\rangle Since gates acts linearly on qubit states, we can therefore calculate the result of applying the cNOT to an arbitrary 2-qubit quantum state: cNOT \cdot |\psi\rangle = \alpha |00\rangle + \beta |01\rangle + \delta |10\rangle + \gamma|11\rangle Matrix forms The four 2-qubit basis states has a vector representation: |00\rangle = \left1 \\ 0 \\ 0 \\ 0 \\ \end{matrix}\right, |01\rangle = \left0 \\ 1 \\ 0 \\ 0 \\ \end{matrix}\right, |10\rangle = \left0 \\ 0 \\ 1 \\ 0 \\ \end{matrix}\right, |11\rangle = \left0 \\ 0 \\ 0 \\ 1 \\ \end{matrix}\right Deriving these from the 2 dimensional basis vectors requires something called a tensor product, and will be treated in the next course. The cNOT has a matrix representation as well: cNOT = \left1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{matrix}\right Applying the cNOT to a 2-qubit state is the same as multiplying the cNOT matrix with the state. This carries over larger composite systems as well. In general, a vector representing an N-qubit state requires 2N elements, and the matrix M for a gate operating on N qubits is of dimensions (2N,2N): Lecture 4 - Entanglement, Bell states Coming... Lecture 5 - Qubits and phases, complex amplitudes, the bloch sphere This lecture is advanced, and only acts as a bridge between this course and the next. This will be treated more in the next course. Real coefficients and the unit circle If we are dealing only with real coefficients 'a' and 'b', we don't have to use a two dimensional complex plane, but the regular two dimensional real plane will do (a.k.a. just "the plane"). We have a qubit state: |\psi\rangle = a|0\rangle + b|1\rangle = a(1,0) + b(0,1) We also have the normalization constraint: a^2 + b^2 = 1 This means all "legal" qubit states lie on the unit circle. This in turn means we can express them in terms of an angle: a = \cos (t) b = \sin (t) Naturally, due to the trigonometric identity: a^2 + b^2 = \cos^2(t) + \sin^2(t) = 1 This means we have a good, compact way of representing these types of qubits - simply as an angle! Complex coefficients and the Bloch sphere What about when 'a' and 'b' are complex. Can we still use an angle? If not, can we extend the angle representation somehow to the general case? It turns out we can, but it takes a bit of work. Let us assume the numbers are complex, and let's call them 'z' and 'w'. We have the general state: |\psi\rangle = z|0\rangle + w|1\rangle The normalization constraint means we have: |z|^2 + |w|^2 = 1 First thing to consider here is that a complex number z with the modulus |z| = 1 can be expressed as a complex exponential corresponding to some angle (the argument of z): z = e^{i\phi} = \cos (\phi) + i \cdot \sin (\phi) The problem here is that 'z' and 'w' doesn't have to have modulus one - they only restraint is that the sum of the squares of their moduli must be 1. If two complex numbers satisfy the normalization constraint, we can however re-write them as such: z = v \cdot \cos (\theta) w = u \cdot \sin (\theta) v and u here are the complex numbers with the same arguments as z and w, respectively, but with modulus 1. Clearly we have: |z|^2 + |w|^2 = |v|^2 \cdot \cos^2(\theta) + |u|^2 \cdot \sin^2(\theta) = \cos^2(\theta) + \sin^2(\theta) = 1 v and u has modulus 1, so they can be expressed simply as complex exponentials: v = e^{i\phi_0} u = e^{i\phi_1} Given this relationship, we can now express the qubit in the following way: |\psi\rangle = z|0\rangle + w|1\rangle = e^{i\phi_0} \cdot \cos(\theta)|0\rangle + e^{i\phi_1}\sin(\theta)|1\rangle This involves three angles, but we will actually only need two. If the only thing separating two qubits is a global phase, meaning if this equation holds: |\psi\rangle = e^{i\phi}|\xi\rangle This means the qubits are the same. There is no way of distinguishing between the two. We can use this to cheat, and multiply the qubit with the negative of the first phase factor, to get this: |\psi\rangle = e^{-i\phi_0}|\psi\rangle = \cos(\theta)|0\rangle + e^{i(\phi_1 - \phi_0)}\sin(\theta)|1\rangle We can call the difference of the angles simply ϕ (the relative phase), and re-write the expression. We're also gonna use half θ for reasons that will be made clear later: |\psi\rangle = \cos \left(\frac{\theta}{2}\right)|0\rangle + e^{i\phi}\sin \left(\frac{\theta}{2} \right)|1\rangle We have now expressed a qubit as two angles. One question remains though - angles with respect to what? What are the axes of rotation? The answer to this question comes in the form of the Bloch sphere, and it will be covered in the next course, but we're essentially dealing with three axes, and the X, Y and Z gates corresponds to rotations around these axes. What the phase gates do is essentially to modify the relative phase (the angle ϕ).